<template>
	<view class="content">
		<!-- '?Open_ID=' + Open_ID -->
		<web-view v-if="BASE_Path" :src="BASE_NAME +  BASE_Path + Query"></web-view>
	</view>
</template>
<script>
	const app = getApp();
	import { mapState , mapMutations } from 'vuex';
	import { getRedis } from '@/api/generalBusiness.js';
	export default {
		computed:{
			...mapState(['BASE_Path', 'BASE_NAME','Open_ID','BASE_Query']),
			Query(){
				let obj = {Open_ID:this.Open_ID,...this.BASE_Query};
				let str = "";
				for(let key in obj){
					if(str==""){
						str = "?" + key + "=" + obj[key]
					} else {
						str =  str + "&" + key + "=" + obj[key]
					}
				}
				return str
			},
		},
		// methods:{
		// 	...mapMutations(['setBASEPath','setBASEQuery']),
		// 	async refreshWebView(){
		// 		//情况1. web-view 内部之间跳转,通过 监听redis跳转 页面路径 回写到  "BASE_Path"
		// 		//情况2. 小程序 跳转 web-view 直接回写到 "BASE_Path"
		// 		//情况3. web-view 跳转 到内部页面 无操作
				
		// 		//1.查询redis获取跳转路径
		// 		//2.判断该路径是否与当前BASE_Path一致
		// 		//3.若不一致则更新BASE_Path
		// 		const res = await getRedis({Key:`${Open_ID};;BASE_Path`});
		// 		if(res.Status == 'success'){
		// 			let Path = res.Data.Path;
		// 			let Query = res.Data.Query;
		// 			if(this.BASE_Path != Path){
		// 				this.setBASEPath(Path);//跳转路径
		// 				this.setBASEQuery(Query);//传参
		// 			}
		// 		}
		// 	}
		// },
		// onShow(){
		// 	this.refreshWebView();
		// }
	}
</script>
